package other.getech.oa.api;

import com.rkhd.platform.sdk.api.annotations.RequestMethod;
import com.rkhd.platform.sdk.api.annotations.RestApi;
import com.rkhd.platform.sdk.api.annotations.RestMapping;
import com.rkhd.platform.sdk.log.Logger;
import com.rkhd.platform.sdk.log.LoggerFactory;
import other.getech.oa.model.NotifyMessageContext;
import other.getech.oa.service.OAService;

/**
 * 需求:用于测试
 *
 * @date: 2024-03-16 10:01
 */
@RestApi(baseUrl = "/oa")
public class OAApi {
    private static final Logger logger = LoggerFactory.getLogger();

    // https://api-p05.xiaoshouyi.com/rest/data/v2.0/scripts/api/oa/test?loginName=testtodo
    @RestMapping(value = "/test", method = RequestMethod.GET)
    public void test() throws Exception {
        logger.debug("test");
        new OAService().submit("quote", 3214030448545070L, 3179065160420707L);
    }

    // https://api-p05.xiaoshouyi.com/rest/data/v2.0/scripts/api/oa/test2
    @RestMapping(value = "/test2", method = RequestMethod.GET)
    public NotifyMessageContext test2() throws Exception {
        logger.debug("test2");
        return new OAService().getTodo("genghai1.wan");
    }

    // https://api-p05.xiaoshouyi.com/rest/data/v2.0/scripts/api/oa/test3
    @RestMapping(value = "/test3", method = RequestMethod.GET)
    public void test3() throws Exception {
        logger.debug("test3");
        new OAService().agree("quote", 3218190118014222L, 3218191653080414L);
    }

    public static void main(String[] args) throws Exception {
        OAApi api = new OAApi();
        api.test();
    }
}
